<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>daysInMonth</title>
</head>

<body>
    <script>
        const daysInMonth = (year, month) => new Date(year, month, 0).getDate();
        document.writeln(`2020年12月有${daysInMonth(2020, 12)}天`)
    </script>
</body>

</html>